#ifndef CONTAINERS_H
#define CONTAINERS_H
#include "qdock.h"

class QDockItemContainer : public QDockItem{
    Q_OBJECT
protected:
    QDockItemContainer(QWidget *parent=0, Qt::WindowFlags flags=0):QDockItem(parent, flags){}
public:
    virtual void removeWidget(QWidget* widget) = 0;
    virtual void replaceWidget(QWidget *old_widget, QWidget* new_widget) = 0;
    virtual bool isHandlerFor(DockOption dockoption){return false;}
    virtual bool dropItem(QDockItem *dragged_widget, QWidget *target_widget, DockOption dockoption){return false;}
    virtual QRect simulateDrop(QDockItem *dragged_widget, QWidget *target_widget, DockOption dockoption){return QRect();}
};



class IndexedContainer : public QDockItemContainer {
    Q_OBJECT
public:
    IndexedContainer(QWidget* parent):QDockItemContainer(parent){}
public:
    virtual void insertWidget(int index, QWidget* widget) = 0;
    virtual void removeWidget(QWidget* widget) = 0;
    virtual int indexOf(QWidget *widget) = 0;
    virtual QWidget* widgetAt(int index) = 0;
    virtual int count() = 0;
    virtual void replaceWidget(QWidget *old_widgets, QWidget *new_widget);
//    virtual int dockingIndex(DockOption dockoption, QWidget* relativeAnchor = 0) = 0;
};


#endif // CONTAINERS_H
